﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using Model;

namespace MusicService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class MusicService : IMusicService
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }


        public MusicManager TestSearchMusic(string searchValue)
        {
            MusicManager tempMusicManager = new MusicManager();
            List<Song> tempSong = new List<Song>();

            tempSong.Add(new Song() { Name = searchValue, Bitrate = "320kb", Varighed = "Sexy Song"});
            tempSong.Add(new Song(){ Name = searchValue, Bitrate = "320kb", Varighed = "Hard Pron"});

            tempMusicManager.AddSongs(tempSong);

            return tempMusicManager;
        }
        public MusicManager SearchMusic(string searchValue)
        {
            return null;
        }
    }
}
